package payroll.webapp

class LoginController {
    def index = { }
	
	def doAuthenticate = {
		def login = Login.findWhere(
			userName:params.username,
			userPassword:params.password)
		
		session.login = login
		
		if (session.login)
			redirect(controller:'adminPage')
		else
			redirect(action:'index')
	}
	
	def doLogout = {
		session.login = null
		redirect(action:'index')
	}
}
